class formVerification {
  // 表单验证
  formDataVerifi (form) {
    if (typeof form.flightNo !== 'string' || form.flightNo === '') {
      return {
        status: false,
        msg: '航班号不能为空'
      }
    }
    if (typeof form.lclDptDate !== 'string' || form.lclDptDate === '') {
      return {
        status: false,
        msg: '航班日期不能为空'
      }
    }
    if (typeof form.idNo !== 'string' || form.idNo === '') {
      return {
        status: false,
        msg: '证件号不能为空'
      }
    } else {
      if (!/^[\d\w]*$/.test(form.idNo)) {
        return {
          status: false,
          msg: '证件号不能有特殊字符或者中文符号'
        }
      }
    }
    return {
      status: true,
      msg: '验证通过'
    }
  }
}

export default formVerification
